int QueueLen(SqQueue Q){
	if(Q->rear>Q->front) return Q->rear-Q->front;
	else return (MAXQSIZE-Q->rear+Q->front);
} 
int EnQueue(SqQueue &Q, Person e){
	if((Q->rear+1)%MAXQSIZE==Q->front) {
		return ERROR;
	}
	Q->rear=(Q->rear+1)%MAXQSIZE;
	Q->data[Q->rear]=e;
	return true;
}
int QueueEmpty(SqQueue &Q){
	return (Q->front==Q->rear);
}
int DeQueue(SqQueue &Q, Person &e){
	if(Q->front==Q->rear) return false;
	Q->front=(Q->front+1)%MAXQSIZE;
	e=Q->data[Q->front];
	return true;
}
void DancePartner(Person dancer[], int num){
	int i;
	Person e;
	for(i=0;i<num;i++){
		if(dancer[i].sex=='M') {
			EnQueue(Mdancers,dancer[i]);
		}
		else if(dancer[i].sex=='F'){
			EnQueue(Fdancers,dancer[i]);
		}
	}
	while(!QueueEmpty(Mdancers)&&!QueueEmpty(Fdancers)){
		DeQueue(Fdancers,e);
		printf("%s  ",e.name);
		DeQueue(Mdancers,e);
		printf("%s\n",e.name);
	}
}
